﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Listproduct.aspx.cs" Inherits="admin_product_Listproduct" %>

<%@ Register src="../usercontrol/category.ascx" tagname="category" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <script type="text/javascript">
        function confirmdelete()
        {  if (window.confirm("Bạn có muốn xóa thông tin về sản phẩm này không ?"))
            {return true;}return false;
        }
        function confirmupdate()
        {  if (window.confirm("Bạn có muốn cập nhật thông tin về sản phẩm này không ?"))
            {return true;}return false;
        }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceLeft" Runat="Server">
    <uc1:category ID="category1" runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <div  class="portlet x9">
                    <div class="portlet-header"><h4>Danh sách sản phẩm</h4></div>
                    <div class="portlet-content">
                        <asp:Button ID="btnxoa" runat="server" CssClass=" btn btn-orange" Text="Xoá sản phẩm chưa đặt hàng" 
                            onclick="btnxoa_Click" />
                        <asp:Label ID="Lbmessage" runat="server" Text=""></asp:Label>
<asp:UpdatePanel ID="upMain" runat="server">
  <ContentTemplate>

        <div class ="pcartborder" style ="border: none; margin: 10px 10px;">
            <div class ="pcartrow" style ="border: none; text-align:center ">
              Chọn nhóm sản phẩm: <asp:DropDownList ID="opcategory" runat="server" 
                    AutoPostBack = "true"  Width="200px" 
                     Font-Names = "Tahoma" 
                    onselectedindexchanged="opcategory_SelectedIndexChanged" 
                    DataMember="Brand_Name" DataValueField="Brand_Id" 
                    DataTextField="Brand_Name" > </asp:DropDownList>
            </div>
            
            <div class ="pcartrow" style ="border: none; text-align: center; color: Red ;">
                 <b><asp:Label ID="lblError" runat="server"></asp:Label></b> 
            </div>
        </div>

        

        <asp:ListView ID="products" runat="server" OnItemDeleting = "products_ItemDeleting"  
                  OnItemUpdating = "products_ItemUpdating" OnPagePropertiesChanging="products_PagePropertiesChanged"  >

             <LayoutTemplate>
         
         <div class ="pcartborder">
           
            <div class ="pcartrow header" style ="font-weight: bold;">
                <div class ="pcartitemno">STT</div>
                <div class ="pcartothername">Tên sản phẩm</div>
                   <div class = "pcardselect"> Tồn kho </div>
                <div class = "pcardselect"> Hot </div>
                <div class = "pcardselect"> Active</div>
            </div> 
            
            <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
            
            <div class="pager">
                <asp:Literal ID="PageInfo" runat="server" >Trang: </asp:Literal>
              <asp:DataPager ID="pager" runat="server" PagedControlID="products" PageSize="10">
                    <Fields>
                        <asp:NumericPagerField CurrentPageLabelCssClass="pager_current" ButtonCount="3" RenderNonBreakingSpacesBetweenControls="false"
                            NextPageText=".." PreviousPageText=".." />
                    </Fields>
                </asp:DataPager>
            </div>
                    
        </div>
         
         </LayoutTemplate>

             <ItemTemplate>
         
        <div  class ="pcartrow" style =" background-color: #F7F7F7 ">
            
            <div class ="pcartitemno">
               <%# Container.DataItemIndex + 1 %>
            </div>
          
            <asp:HiddenField ID="hdid" runat="server" Visible = "false"  Value = '<%#Eval("Products_Id") + "," + Eval("Products_Name")%>' />
           
            <div class ="pcartothername">
               <%#Eval("Products_Name")%>
            </div>
            <div class ="pcardselect">
               <%#Eval("QuantityCurrent")%>
            </div>
            <div class = "pcardselect">
                <asp:CheckBox ID="IsHot" runat="server" Checked='<%# Eval("Ishot") %>' /> 
            </div>

            <div class = "pcardselect">
                <asp:CheckBox ID="IsActive" runat="server"  Checked='<%# Eval("IsActive") %>' />
            </div>
           
            <div class = "pcardsubmit">
                <a href='<%# "http://localhost:2011/didong/Admin/Product/Editproduct.aspx?id=" + Eval("Products_Id")%>' title= '<%#"Sửa chi tiết [ " + Eval("Products_Name") + " ]"%>'> <img src ="http://localhost:2011/didong/images/design/acp_edit.gif" alt = "Sửa" style ="width: 12px ;height: 12px ;border: none; padding-top: 2px;" /> </a>
           </div>
            
            <div class = "pcardsubmit">
                <asp:ImageButton ID=  "btnSave"  CommandName = "Update"  runat="server" OnClientClick = "return confirmupdate()" ImageUrl ="http://localhost:2011/didong/images/design/save_on.gif"  AlternateText = "save"  Width = "15" Height ="15"  ToolTip = "Lưu thay đổi"/>
            </div>
               
            <div class = "pcardsubmit">
                 <asp:ImageButton ID=  "btnDelete"   CommandName = "Delete"  runat="server" OnClientClick = "return confirmdelete()" ImageUrl ="http://localhost:2011/didong/images/design/delete_on.gif"  AlternateText = "Del"  Width = "15" Height ="18"  ToolTip = "Xóa sản phẩm"/>
            </div>
            
        </div>
         
        </ItemTemplate>

        </asp:ListView>   

</ContentTemplate>
</asp:UpdatePanel>
                        
                    </div>
                </div>

</asp:Content>

